package org.fullhappy.business;


import java.util.ArrayList;
import java.util.List;
import javax.faces.model.SelectItem;
import org.fullhappy.dao.SingerFacade;
import org.fullhappy.entity.Singer;

public class SingerService{
    private SingerFacade singerFacade;
    public SingerService() {
        singerFacade = new SingerFacade();
    }
    public ArrayList<SelectItem> getSelectItems() {
        ArrayList<SelectItem> items = new ArrayList<SelectItem>();
        List<Singer> entities = singerFacade.findAll();
        if (entities != null && entities.size() > 0) {
            for (Singer x : entities) {
                items.add(new SelectItem(x.getSingerId(), x.toString()));
            }
        }
        return items;
    }
}
